package com.atguigu.java.ai.langchain4j.Tools;


import dev.langchain4j.agent.tool.P;
import dev.langchain4j.agent.tool.Tool;
import org.springframework.stereotype.Component;

import javax.naming.Name;

@Component
public class CalculatorTools  {

    @Tool(name ="加法运算")
    double sum(
            @P(value = "加数1",required = true) double a,
            double b) {
        System.out.println("调用加法运算");
        return a + b;
    }
    @Tool(name="平方根运算")
    double squareRoot(double x) {
        System.out.println("调用平方根运算");
        return Math.sqrt(x);
    }
}
